package com.yv.websocket.controller.v3;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.stereotype.Controller;

import com.yv.websocket.model.InMessage;
import com.yv.websocket.service.WebSocketService;

/**
 * 
 * 功能描述：简单版单人聊天
 * 
 */
@Controller
public class V3ChatRoomContoller {

	@Autowired
	private WebSocketService ws;
	
	//页面访问localhost:8080/v1/index.html ,输入from和to,然后connect, 另起一个网页,同样操作,然后connect. 
	@MessageMapping("/v3/single/chat")
	public void singleChat(InMessage message) {
		ws.sendChatMessage(message);
	}
	
}
